<template>
    <div>
      <!--<housepicker :show="show" @cancel="cancel" :owner="owner" :houses="houses" :credentials="credentials"></housepicker>-->
    <div style=";width: 100%;z-index: 110;min-height: 50px;background-color: #ffffff;line-height: 50px">
        <div style="padding-left: 15px;color: #81858b;display: inline-block;width: 45%">
            <img :src="zuobiao"/> 您当前的位置：{{routeDesc.firstTitle}}
            <span style="color: #2a3542">{{routeDesc.lastTitle|cutStr(10)}} </span>
        </div>
        <div style="text-align: right;display: inline-block; width: 53%;word-break:break-all;vertical-align:top">
            <span style="color: #81858b">当前房屋：</span>{{currentHouse.address|cutStrReverse(20)}}
            <button @click="show=true" type="button"  class="btn picBtn" >切换房屋</button>
        </div>
    </div>

    </div>

</template>

<script type="application/ecmascript">
    //import housePicker from './housePicker.vue';
    export default {
        name: 'navbar',//导航栏
        data () {
            return {
                show:false,
                zuobiao:this.getImage('zuobiao.png'),
                credentials:sessionStorage.credentials,
                owner: sessionStorage.owner ,
                houses:JSON.parse(sessionStorage.houseList).houselist,
            }
        },
        components:{//引用组件
           // housepicker:housePicker,//模态
        },
        computed:{
            routeDesc:function () {
                return this.$store.getters.getRouteDesc;
            },
            currentHouse:function () {
                return JSON.parse(sessionStorage.currentHouse);
            },
        },
        methods:{
            logout(){
                localStorage.removeItem('token');
                location.href = '/#/login';
            },
            cancel(){
                this.show =false;
            }

        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang='scss' rel="stylesheet/scss" type="text/css">

    .picBtn{
        color:#fff;
        background-color: #2ea5f8;
        width:70px;
        font-size: 10px;
        padding: 4px 0 4px 0;
        text-align: center;
        margin-left: 7px;
    }
</style>
